Skip to content

[FIX]: resolve server_routes_file pointer in gumcp transport config - #33

Merged
gonzaloandresoto merged 3 commits into
mainfrom
gonzalo-fix-gumcp-config-routes-file
Jul 27, 2026
Merged

[FIX]: resolve server_routes_file pointer in gumcp transport config#33
gonzaloandresoto merged 3 commits into
mainfrom
gonzalo-fix-gumcp-config-routes-file

Conversation

@gonzaloandresoto

Copy link
Copy Markdown
Collaborator

Summary

  • server_routes are moving out of the GUMCP_CONFIG env var into a sandbox file (server_routes_file pointer key), because inline routes grow ~1.3KB per visible Gumstack server and blow past the kernel's exec arg/env limit — every process spawn in affected sandboxes fails with fork/exec: argument list too long (E2BIG). Production incident: interaction ubHTArDjKdRPXwBjRdCw72, 1.8k+ log hits over 72h for Gumloop-org users with 60+ visible servers.
  • _load_config() now resolves the server_routes_file pointer into inline server_routes before constructing the gumcp_client.AsyncClient (tolerates missing/malformed files — non-routed servers keep working).
  • The cached-client fingerprint includes the routes file's mtime, so a refreshed per-call routes file rebuilds the session the same way a changed GUMCP_CONFIG string does.

Backward/forward compatible: with today's backend (inline routes, no pointer) this is a no-op. The backend change that writes the file and slims the env var lands separately in gumloop_backend; a companion gumcp-client release adds the same pointer resolution for scripts that construct clients directly.

Test plan

  • uv run pytest tests/sdk/test_gumcp_transport.py — 24 passed, including new tests for pointer resolution, missing/malformed routes file tolerance, and fingerprint invalidation on routes-file mtime change
  • uv run ruff check clean on both files

Made with Cursor

server_routes now ship as a sandbox file instead of inline in the
GUMCP_CONFIG env var (oversized env blocks broke every sandbox exec
with E2BIG for orgs with many gumstack servers). the transport loads
the file into the client config and keys the cached client on the
file's mtime so a refreshed per-call file rebuilds the session.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread src/gumloop/_gumcp_transport.py Outdated
Comment thread src/gumloop/_gumcp_transport.py Outdated
Comment thread src/gumloop/_gumcp_transport.py Outdated

@dvlpjrs dvlpjrs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: you might need to upgrade version

gonzaloandresoto and others added 2 commits July 24, 2026 19:59
An unreadable or corrupt routes file left routed servers silently missing
from the config. Keep the degrade, since a client with only gateway servers
has no routes file at all, but say so at warning level.

Drops two comments that restated the code.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@gonzaloandresoto

Copy link
Copy Markdown
Collaborator Author

Bumped to 0.4.6 in 4e3cf86 (uvx hatchling version reports 0.4.6, so the release workflow tag check will pass against v0.4.6). Leaving the tag to you after merge.

@gonzaloandresoto
gonzaloandresoto merged commit 3766acb into main Jul 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants